import java.util.Arrays;
import java.util.Scanner;

public class 松散子序列 {
    static int N = 1000010;
    static char[] c = new char[N];
    static int[] f = new int[N];
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        String s2 = s.nextLine();
        for (int i=1;i<=s2.length();i++) c[i] = s2.charAt(i-1);

        int count=0;
        f[1] = c[1]-96;
        for (int i=2;i<=s2.length();i++) {
            f[i] = Math.max(f[i-1],f[i-2]+c[i]-96);
        }
        System.out.println(f[s2.length()]);
    }
}
